package com.ruoyi.common.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * 前台页面类型
 *
 * @author ruoyi
 */
public enum HtmlPageTypeEnum {
    INDEX("index" , "首页", "vm/html/index.html.vm", ""),
    ABOUT("about" , "关于科辉", "vm/html/about.html.vm", "/about"),
    SUPPORT("support" , "服务支持", "vm/html/support.html.vm", "/support"),
    PRODUCT_INDEX("productIndex" , "产品中心", "vm/html/productList.html.vm", "/productIndex/{}"),
    PRODUCT_TYPE("productType" , "产品类型下产品列表", "vm/html/productList.html.vm", "/productList/{}/{}"),
    SOLUTION_INDEX("solutionIndex" , "行业解决方案", "vm/html/solutionIndex.html.vm", "/solutionIndex"),
    SOLUTION("solution" , "解决方案下产品列表", "vm/html/solutionList.html.vm", "/solutionList/{}/{}"),
    VIDEO_INDEX("videoIndex" , "项目视频列表", "vm/html/videoList.html.vm", "/videoList/{}"),
    NEWS_INDEX("newsIndex" , "公司新闻首页", "vm/html/newsList.html.vm", "/newsIndex/{}"),
    NEWS_TYPE("newsType" , "公司新闻/行业资讯", "vm/html/newsList.html.vm", "/newsList/{}/{}"),
    CONTACT("contact" , "联系我们", "vm/html/contact.html.vm", "/contact"),
    PRODUCT("product" , "产品详情", "vm/html/productDetail.html.vm", "/product/{}"),
    VIDEO("video" , "项目视频详情", "vm/html/videoDetail.html.vm", "/video/{}"),
    NEWS("news" , "新闻详情", "vm/html/newsDetail.html.vm", "/news/{}"),
    PRODUCT2("product2" , "解决方案下的产品详情", "vm/html/product2Detail.html.vm", "/product2/{}"),
    ;

    private String value;
    private String description;
    private String vmFileName;
    private String genHtmlPath;

    HtmlPageTypeEnum(String value, String description, String vmFileName, String genHtmlPath) {
        this.value = value;
        this.description = description;
        this.vmFileName = vmFileName;
        this.genHtmlPath = genHtmlPath;
    }

    public static List<String> allValues() {
        List<String> list = new ArrayList<>();
        for (HtmlPageTypeEnum htmlPageTypeEnum : values()) {
            list.add(htmlPageTypeEnum.getValue());
        }
        return list;
    }

    public String getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    public String getVmFileName() {
        return vmFileName;
    }

    public String getGenHtmlPath() {
        return genHtmlPath;
    }

    public static HtmlPageTypeEnum getByValue(String value) {
        for (HtmlPageTypeEnum htmlPageTypeEnum : values()) {
            if (htmlPageTypeEnum.getValue().equals(value)) {
                return htmlPageTypeEnum;
            }
        }
        return null;
    }

}
